version: '2.4'
services:
  mysql:
    image: "mysql:5.6"
    restart: always
    networks:
      - mm-test
    environment:
      MYSQL_ROOT_HOST: "%"
      MYSQL_ROOT_PASSWORD: mostest
      MYSQL_PASSWORD: mostest
      MYSQL_USER: mmuser
      MYSQL_DATABASE: mattermost_test
  postgres:
    image: "postgres:9.4"
    restart: always
    networks:
      - mm-test
    environment:
      POSTGRES_USER: mmuser
      POSTGRES_PASSWORD: mostest
      POSTGRES_DB: mattermost_test
    command: postgres -c 'config_file=/etc/postgresql/postgresql.conf'
    volumes:
     - "./docker/postgres.conf:/etc/postgresql/postgresql.conf"
  minio:
    image: "minio/minio:RELEASE.2019-10-11T00-38-09Z"
    command: "server /data"
    networks:
      - mm-test
    environment:
      MINIO_ACCESS_KEY: minioaccesskey
      MINIO_SECRET_KEY: miniosecretkey
      MINIO_SSE_MASTER_KEY: "my-minio-key:6368616e676520746869732070617373776f726420746f206120736563726574"
  inbucket:
    image: "jhillyerd/inbucket:release-1.2.0"
    restart: always
    networks:
      - mm-test
  openldap:
    image: "osixia/openldap:1.2.2"
    restart: always
    networks:
      - mm-test
    environment:
      LDAP_TLS_VERIFY_CLIENT: "never"
      LDAP_ORGANISATION: "Mattermost Test"
      LDAP_DOMAIN: "mm.test.com"
      LDAP_ADMIN_PASSWORD: "mostest"
  elasticsearch:
    image: "mattermost/mattermost-elasticsearch-docker:6.5.1"
    networks:
      - mm-test
    environment:
      http.host: "0.0.0.0"
      http.port: 9200
      http.cors.enabled: "true"
      http.cors.allow-origin: "http://localhost:1358,http://127.0.0.1:1358"
      http.cors.allow-headers: "X-Requested-With,X-Auth-Token,Content-Type,Content-Length,Authorization"
      http.cors.allow-credentials: "true"
      transport.host: "127.0.0.1"
      ES_JAVA_OPTS: "-Xms512m -Xmx512m"
  dejavu:
    image: "appbaseio/dejavu:3.4.2"
    networks:
      - mm-test
  keycloak:
    image: "jboss/keycloak:10.0.2"
    restart: always
    environment:
      KEYCLOAK_USER: mmuser
      KEYCLOAK_PASSWORD: mostest
      DB_VENDOR: h2
      KEYCLOAK_IMPORT: /setup/realm.json
    networks:
      - mm-test
    volumes:
     - "./docker/keycloak:/setup"
